(function () {

    angular.module('cf-content').directive('cfFooter', ['$timeout', "$window", function ($timeout, $window, EVENT) {
            return {
                restrict: 'AE',
                templateUrl: 'app/footer/footer.html',
                replace: true,
                controller: ['$scope', cfFooter],
                link: function (scope, element, attrs, ngModel) {
                    scope.fixed = true;
                    scope.$on('$viewContentLoaded', function () {
                        $timeout(function () {
                            console.log(document.body.clientHeight, $window.innerHeight)
                            if (document.body.clientHeight + 85 > $window.innerHeight)
                                scope.fixed = false;
                            else
                                scope.fixed = true;
                        }, 300, true)
                    });
                }
            }
        }])

    function cfFooter($scope) {
        $scope.footerInfo = '财富建材家居网 版权所有 Copyright © 2016 www.chifull.com'
    }

})();

